<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,user-scalable=0"/>
    <meta charset="UTF-8">
    <title>BD健身</title>
    <script src="__api__/js/fontSize.js"></script>
    <link rel="stylesheet" href="__api__/css/bootstrap.min.css">
    <link rel="stylesheet" href="__api__/css/reset.css">
    <link rel="stylesheet" href="__api__/css/my_main.css">
    <link rel="stylesheet" href="__api__/css/dropload.css">
    <style>
        body{
            background-image:url("__api__/images/login_back2.jpg");
            background-repeat: no-repeat;
            background-size: cover;
            width: 100%;
            height: 100%;

        }

    </style>
</head>
<body ontouchstart=""  id="container">
<!--<header class="tabHead">-->
<!--<span class="active">我的收藏</span>-->
<!--<span>我的评价</span>-->
<!--<div class="sanjiao"></div>-->
<!--</header>-->
<div class="login">
    <div class="loginTitle">
        <div class="logo">
            <img src="__api__/images/logo.png">
        </div>
        <div class="title">
            <img src="__api__/images/bd_title.png">
        </div>
    </div>
    <div class="myLogin">
        <div class="container">
            <header class="tabHead">
                <a href="__up__/api/user/login"> <span>用户登录</span></a>
                <span class="active">商家登录</span>
                <b class="border" style="left: 288px;"></b>
            </header>
        </div>

    </div>

    <div class="khfxWarp">
        <div class="container">
            <section class="form khfxPane" style="display:block">
                <div class="formLogin">


                    <form action="#" class="form-horizontal form_login" onsubmit="return false">
                        <div class="form-group">
                            <input class="form-control" type="tel" name="telphone" placeholder="手机号" value="{$Think.cookie.tel}" required>
                        </div>
                        <div class="form-group number">

                            <input class="form-control" id="password" type="password" name="password" placeholder="密码"
                            
                            value="{$Think.cookie.pwd}"
                            
                            required>
                            <a href="javascript:" style="right: 0;" id="passwordeye" class="hide_pwd"></a>


                        </div>
                        <div class="form-group loginBtn" id="sub">
                            <button class="btn btn-primary">
                                <span>登录</span>
                            </button>
                        </div>
                        <div class="remember">
                       <div class="checkbox pull-left">
                            <input class="magic-checkbox" type="checkbox" name="layout" id="c1" value="1" checked>
                            <label for="c1">记住密码</label>
                        </div>
                        </div>
                    </form>
                    
                       
                    </div>

                    
                </div>

            </section>


        </div>

    </div>

</div>

<script src="__api__/js/jquery-3.2.1.min.js"></script>
<script src="__api__/js/bootstrap.min.js"></script>
    <script src="__assets__/layui.js"></script>
<script type="text/javascript">

$(function(){
$('#sub').click(function(){
	//alert('d');
	var layer;//全局变量 layui的弹窗
	layui.use('layer', function(){
		layer = layui.layer;
		});
	var url="__up__/api/user/Clogin";
	//console.log("{:url('api/user/Clogin')}");
	var data=$("form").serialize();
	$.post(url,data,function(res){
		var obj=eval('('+ res +')');
		var msg=decodeURI(obj.info);
		console.log(obj);
		if(obj.status==-1){
			layui.use('layer', function(){
				  var layer = layui.layer;
				  
				  layer.msg(msg, {icon: 6}); 
				});     
		}else if(obj.status==1){
			//$.amaran({'message':msg});
		    //console.log($.amaran);
		   layer.msg(msg, {
                      icon: 6,
              time: 2000 //2秒关闭（如果不配置，默认是3秒）
              },function(){
            	  var url = obj.data;
                  window.location.href=url; 
              });
  //do something
			
		}else if(obj.status==0){
			layer.msg(msg,{icon:5});
		}else {
			layer.msg(msg, {
                icon: 5,
        time: 2000 //2秒关闭（如果不配置，默认是3秒）
        },function(){
      	  var url = obj.data;
          window.location.href=url; 
        });
		}
	});
});
})

</script>
</body>
</html>